export default {
    // state形参 => state对象,用于修改state上的数据
    addA: function (state, payload) {
        console.log("addA被调用", payload);
        state.a++;
    },
    addB: function (state, payload = 1) {
        console.log("addB被调用", payload);
        state.b += payload;
    },
    addBoth: function (state, payload = {}) { // payload = {m,n}
        var { m = 1, n = 1 } = payload;
        state.a += m;
        state.b += n;
    }
}